#!/usr/bin/env	python
#!-*- coding:utf-8 -*-
#@author	Amiber
#@date	2012-12-01
#@brief grap the table-data in static-web

import urllib2
from bs4 import BeautifulSoup
import re
import string

def earse(strline,ch) :
    left = 0
    right = strline.find(ch)

    while right !=-1 :
        strline = strline.replace(ch,'')
        right = strline.find(ch)
    return strline

url = r"http://quote.eastmoney.com/center/list.html#28002478_0_2"

resContent = urllib2.urlopen(url).read()

resContent = resContent.decode('gb18030').encode('utf8')

soup = BeautifulSoup(resContent)

print soup('title')[0].string

tab= soup.findAll('table')

trs = tab[len(tab)-1].findAll('tr')

for trIter in trs :
    tds = trIter.findAll('td')
    for tdIter in tds :
        span = tdIter('span')
        for i in range(len(span)) :
            if span[i].string :
                print earse(span[i].string,' ').strip(),
            else :
                pass
    print
		